<template>
    <div class="easyd-weixin-Box">

        <div class="search_box">
            <input type="text" id="" value="" placeholder="请输入客户的微信昵称！"/>
            <span class="search">搜索</span>
        </div>
        <div class="app_page_box" style="top: 40px;">
            <div class="app_page">
                <div class="customer_pool_list app_box_content_list app_list_box" v-for="item in weChatData" @click="goCustomerDetail(item)">
                    <!--<img src="../../../../static/images/fuwukaxiangqing3.jpg" />-->
                    <div class="txt_img" v-if="item.apurr_header == ''">
                        {{item.apurr_nickname[0]}}
                    </div>
                    <div class="headerImg" v-else>
                        <img :src="item.apurr_header" >
                    </div>
                    <div class="customer_pool_info">
                        <div class="app_box_flex">
                            <div class="app_box_content_left app_box_flex_1">
                                <span class="campus_name">{{item.apurr_nickname}}</span>
                                <span class="C4">(游客)</span>
                            </div>
                            <div class="app_box_content_right">
                                <span class="T2">{{$common.getTimes(item.apurr_create_time)}}</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</template>

<script>
    import {mapState, mapMutations} from "vuex";

    export default {

        data() {
            return {
                navListActive: '0', //顶部菜单选中
            };
        },
        computed: {
            ...mapState({
                weChatData: state => state.WeChatCustomerModule.weChatData,
			    form : state => state.AddClientModule.form,
            }),
        },
        mounted() {
            this.initData();
        },
        methods: {

            //  ...mapMutations(["ShopIndexModule/updateIsShopGuide"]),
            initData() {
            	
                var uids = this.$userData.getUID();
                
                this.$easyUtil.startLoading(this);
                this.$http.getHttp(
                    this.$API.canBeAddCustomer + "/u_id/"+uids,
                    rs => {
                        this.$easyUtil.endLoading(this);
                        console.log(rs);
                        this.$store.commit("WeChatCustomerModule/updateWeChatData", rs.weChatMemberArr);
                    }
                );
            },
            goCustomerDetail(item){
				this.form.wx_nickname = item.apurr_nickname;
				this.form.openid = item.apurr_openid;
				history.go(-1);
            },
        },

    };
</script>

<style lang="stylus" scoped>
    @import '~PUBLIC_CSS';
    .search_box {
        line-height: 40px;
        background: #fff;
        margin-bottom: 5px;
        text-align: center;
        display: flex;
        align-items: center;
    }

    .search_box .screen {
        flex: 1;
    }

    .search_box input {
        flex: 3;
        border-radius: 100px;
        border: 0;
        background: #f4f4f4;
        padding: 5px 10px;
        margin-left: 15px;
    }

    .search_box .search {
        flex: 1;
        color: #FBD415;
    }


    .customer_pool_list {
        overflow: hidden;
        line-height: 40px;
    }

    .customer_pool_list .customer_pool_info {
        float: initial;
    }

    .customer_pool_list .customer_pool_time {
        overflow: hidden;
        width: 100%;
    }

    .customer_pool_list .customer_pool_time .app_float_right {
        border: 1px solid #fbd415;
        padding: 0 10px;
        line-height: initial;
        border-radius: 4px;
        margin-top: 5px;
    }

    .customer_pool_list .txt_img {
        display: block;
        height: 20px;
        width: 20px;
        margin: 5px;
        padding: 5px;
        margin-left: 0;
        text-align: center;
        line-height: 20px;
        background: #000;
        color: gold;
        float: left;
        border-radius: 100px;
        object-fit: cover;
    }

    .customer_pool_list img {
        display: block;
        /*height: 50px;*/
        /*width: 70px;*/
        /*padding: 5px 10px 5px 0;*/
        float: left;
        object-fit: cover;
    }
    
    .campus_name{
    	max-width: 65%;
    	overflow: hidden;
    	text-overflow: ellipsis;
    	white-space: nowrap;
    	display: block;
    	float: left;
    }
    .headerImg{
        height 30px
        width 30px
        border-radius 50%
        overflow hidden
        margin: 5px;
        margin-left: 0;
        float left
    }
</style>